A method or procedure that solves a particular problem or performs some desired task. Programmers write instructions to implement particular algorithms in their programs. The choice of algorithm affects performance, memory requirements and so forth.